#include <stdio.h>
#include"queue.h"

int main(int argc, char *argv[])
{
	// argv[1]每一个字符入栈
	if (argc < 2)
		return 1;
	queue_t *myqueue = NULL;
	char i;

	queue_init(&myqueue, sizeof(char));

	i = 0;
	while (argv[1][i]) {
		if (-1 == enqueue(myqueue, argv[1] + i)) {
			printf("栈满了\n");
			break;
		}
		i++;
	}

	while (!queue_is_empty(myqueue)) {
		dequeue(myqueue, &i);
		putchar(i);
	}
	putchar('\n');

	queue_destroy(&myqueue);

	return 0;
}



